layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;


    /**
     * 初始化店长
     */
    var languageAjax = new $ax(Feng.ctxPath + "/btyGoodsPay/selectShopOwer?yaoma="+Feng.getUrlParam("yaoma"));
    var languageResult = languageAjax.start();
    console.info(languageResult);
    $.each(languageResult, function (index, val) {
        if(languageResult!=undefined){
            $("#dzName").append("<option value='" + val.bh + "'>" + val.xm+ "</option>");
        }
    });
    form.render('select');



    //表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/btyCwFine/editItem", function (data) {
            // Feng.success("更新成功！");
            //关掉对话框
            admin.closeThisDialog();
        }, function (data) {
            Feng.error("更新失败！" + data.responseJSON.message)
        });
        ajax.set(data.field);
        var dzBh=$("#dzName").find("option:selected").val();
        var dzName=$("#dzName").find("option:selected").text();
        ajax.set("dzBh",dzBh);
        ajax.set("dzName",dzName);
        ajax.start();

        return false;
    });

});
